package com.golang.api.controller;

import com.golang.api.dto.request.OrderInfoCreateDto;
import com.golang.api.dto.request.UserAccountDto;
import com.golang.api.dto.response.order.CreateOrderDto;
import com.golang.api.service.IOrderService;
import com.golang.api.service.IUserAccountService;
import com.golang.api.util.Result;
import com.golang.api.util.ResultGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/api/user/account")
public class UserAccountController {

    @Autowired
    private IUserAccountService userAccountService;

    /**
     * 新增用户银行卡信息
     *
     * @param usreAccount
     * @return
     */
    @PostMapping(value = "/add")
    public Result add(@ModelAttribute UserAccountDto usreAccount) {
        log.info("添加用户银行卡信息:{}", usreAccount);
        boolean success = userAccountService.add(usreAccount);
        return ResultGenerator.success().setResult(success);
    }

}
